<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/style/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/artDialog/jquery.artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="/artDialog/plugins/iframeTools.source.js"></script>
    <script type="text/javascript" src="/js/commonAll.js"></script>
    <title>叩丁狼教育PSS（演示版）-品牌管理</title>
    <style>
        .alt td{ background:black !important;}
    </style>
    <script type="text/javascript">
    $(function(){
    	$(".selectProduct").click(function () {
	        //获取到按钮上绑定的商品信息
	        var productInfo = $(this).data("productinfo");
	        //添加共享数据
	        $.dialog.data("productInfo", productInfo);
	        //关闭当前子窗口
	        $.dialog.close();
	    });
    })
	    
    </script>
</head>
<body>
<form id="searchForm" action="/product/selectProduct" method="post">

    <div id="container">
       	<div class="ui_content">
	            <div class="ui_text_indent">
	                <div id="box_border">
	                    <div id="box_top">搜索</div>
	                    <div id="box_center">
	                        商品名称/编码
	                        <input type="text" class="ui_input_txt02" value="${qo.keywords}" name="keywords" />
	                        品牌
	                 <select class="ui_select01" name="brandId">
	                     <option value="-1">全部</option>
	            			<c:forEach items="${brands}" var="b">
	                      		<option ${b.id==qo.brandId ? 'selected':''} value="${b.id}">${b.name}</option>
	            			</c:forEach>
	                 </select>
	             </div>
	             <div id="box_bottom">
	                 <input type="button" value="查询"  class="ui_input_btn01 btn_page"/>
	             </div>
	         </div>
	     </div>
	 </div>
        <div class="ui_content">
            <div class="ui_tb">
                <table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
                    <tr>
                        <th width="30"><input type="checkbox" id="all" /></th>
                        <th>商品图片</th>
                        <th>商品名称</th>
                        <th>商品编码</th>
                        <th>商品品牌</th>
                        <th>商品成本价</th>
                        <th>商品销售价</th>
                        <th></th>
                    </tr>
                    <tbody>
					<c:forEach items="${result.listData}" var="product">
                    <tr>
                        <td><input type="checkbox" name="IDCheck" class="acb" /></td>
                        <td><img width="80px" src="${product.imagePath}"></td>
                        <td>${product.name}</td>
                        <td>${product.sn}</td>
                        <td>${product.brandName}</td>
                        <td>${product.costPrice}</td>
                        <td>${product.salePrice}</td>
                        <td>
                       		 <input type="button" value="选择该商品"  data-productinfo='${product.productInfo}' class="ui_input_btn01 selectProduct"/>
                        </td>
                    </tr>
					</c:forEach>
                    </tbody>
                </table>
            </div>
            <div class="ui_tb_h30">
                <div class="ui_flt" style="height: 30px; line-height: 30px;">
                    共有
                    <span class="ui_txt_bold04">${result.totalCount}</span>
                    条记录，当前第
                    <span class="ui_txt_bold04">${result.currentPage}/${result.totalPage}</span>
                    页
                </div>
                <div class="ui_frt">
                    <input type="button" value="首页" class="ui_input_btn01 btn_page" data-page="1"/>
                    <input type="button" value="上一页" class="ui_input_btn01 btn_page" data-page="${result.prevPage}"/>
                    <input type="button" value="下一页" class="ui_input_btn01 btn_page" data-page="${result.nextPage}"/>
                    <input type="button" value="尾页" class="ui_input_btn01 btn_page" data-page="${result.totalPage}"/>

                    <select name="pageSize" class="ui_select02 change_event">
                        <option>5</option>
                        <option>10</option>
                        <option>15</option>
                    </select>
                    <script type="text/javascript">
	                    	$("[name=pageSize] option").each(function(index,option){
	                			if(option.value=='${result.pageSize}'){
	                				option.selected=true;
	                			}
	                		});
	                
                    </script>
                    转到第<input type="text" name="currentPage" value="${result.currentPage}" class="ui_input_txt01" />页
                    <input type="submit" class="ui_input_btn01" value="跳转"/>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>
